
#include <oal_string.h>
#include <ctype.h>
OAL_DECL(char *) oal_strncpy(char *dest,const char *src,size_t len)
{
	size_t n;
	OAL_ASSERT(dest && src);
	n = strlen(src);
	if(n > len)
		n = len;
	memcpy(dest,src,n);
	dest[len] = '\0';
	return dest;
}

OAL_DECL(char *) oal_strim(char *s)
{
	char *e;
	while(*s && isspace(*s)){
		s++;
	}
	if(!*s){
		return s;
	}
	e = s+strlen(s)-1;
	while(*s )
}


OAL_DECL(char *) oal_strdup(const char *s)
{
	char *ds;
	size_t len;
	OAL_ASSERT(s);
	len = strlen(s);
	ds = oal_malloc(;
	memcpy(ds,s,len);
	return ds;
}

OAL_DECL(int) oal_strcmp(const char *s1,const char *s2)
{
	OAL_ASSERT(s1 && s2);
	return strcmp(s1,s2);
}
OAL_DECL(int) oal_stricmp(const char *s1,const char *s2)
{
	OAL_ASSERT(s1 && s2);
	
	return stricmp(s1,s2);
}
OAL_DECL(int) oal_strncmp(const char *s1,const char *s2,size_t len)
{
	OAL_ASSERT(s1 && s2);
	return strncmp(s1,s2);
}
OAL_DECL(int) oal_strnicmp(const char *s1,const char *s2,size_t len)
{
	OAL_ASSERT(s1 && s2);
}

//将ip转换成字符串(str长度至少为16)
OAL_DECL(char *) oal_iptoa(uint32_t ip,char *str);
OAL_DECL(uint32_t) oal_atoip(char *str);

/*
	char *str = "123.2332.222.222";
	oal_str_t ostr[12];
	oal_split(str,ostr,12);

*/
OAL_DECL(int) oal_split(char *str,char c,char *strs[],size_t strs_len)
{
	ASSERT(str && strs);

	
}